import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { LaborHourRoutingModule } from "./labor-hour-routing.module";
import {
    BsDatepickerConfig,
    BsDaterangepickerConfig,
    BsLocaleService,
    ModalModule,
    TabsModule,
    TooltipModule,
    PopoverModule,
    BsDropdownModule,
    BsDatepickerModule
} from "ngx-bootstrap";
import { NgxBootstrapDatePickerConfigService } from "assets/ngx-bootstrap/ngx-bootstrap-datepicker-config.service";
import { LibraryComponent } from "./library/library.component";
import { TableModule } from "primeng/table";
import {
    AutoCompleteModule,
    EditorModule,
    FileUploadModule as PrimeNgFileUploadModule,
    InputMaskModule,
    PaginatorModule,
    FileUploadModule,
    TreeModule,
    DragDropModule,
    ContextMenuModule,
    CalendarModule
} from "primeng/primeng";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { UtilsModule } from "@shared/utils/utils.module";
import { AppCommonModule } from "@app/shared/common/app-common.module";
import { NgxChartsModule } from "@swimlane/ngx-charts";
import { CountoModule } from "angular2-counto";
import { TextMaskModule } from "angular2-text-mask";
import { ImageCropperModule } from "ngx-image-cropper";
import { CreateOrEditLibraryModalComponent } from "./library/create-or-edit-library-modal.component";
import { EditRouteModalComponent } from "./library/edit-route-modal.component";
import { StatisticsComponent } from "./statistics/statistics.component";
import { TreeTableModule } from "primeng/treetable";
import { ReportMonthComponent } from "./report-month/report-month.component";

@NgModule({
    imports: [
        TreeTableModule,
        LaborHourRoutingModule,
        FormsModule,
        ReactiveFormsModule,
        CommonModule,
        FileUploadModule,
        UtilsModule,
        AppCommonModule,
        TableModule,
        TreeModule,
        DragDropModule,
        ContextMenuModule,
        PaginatorModule,
        PrimeNgFileUploadModule,
        AutoCompleteModule,
        EditorModule,
        InputMaskModule,
        NgxChartsModule,
        CountoModule,
        TextMaskModule,
        ImageCropperModule,
        CalendarModule,
        ModalModule.forRoot(),
        TabsModule.forRoot(),
        TooltipModule.forRoot(),
        PopoverModule.forRoot(),
        BsDropdownModule.forRoot(),
        BsDatepickerModule.forRoot()
    ],
    declarations: [
        LibraryComponent,
        CreateOrEditLibraryModalComponent,
        EditRouteModalComponent,
        StatisticsComponent,
        ReportMonthComponent
    ],
    providers: [
        {
            provide: BsDatepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerConfig
        },
        {
            provide: BsDaterangepickerConfig,
            useFactory:
                NgxBootstrapDatePickerConfigService.getDaterangepickerConfig
        },
        {
            provide: BsLocaleService,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerLocale
        }
    ]
})
export class LaborHourModule { }
